package com.smartao.base.selectitem;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;
import org.hibernate.annotations.ForeignKey;

import com.smartao.base.module.Module;
import com.smartao.base.selecttype.Selecttype;
import com.smartao.core.orm.entity.BaseEntity;

/**
 * 选择项实体类
 * @author sunxing
 */
@Entity
@Table(name = "T_BASE_SELECTITEM")
public class Selectitem extends BaseEntity<Selectitem> {

	private static final long serialVersionUID = 5334352706173321201L;

	private String name;

	@ManyToOne
	@ForeignKey(name = "none")
	@JoinColumn(name = "selecttype")
	@Fetch(FetchMode.JOIN)
	private Selecttype selecttype;
	
	@ManyToOne
	@ForeignKey(name = "none")
	@JoinColumn(name = "parent")
	@Fetch(FetchMode.JOIN)
	private Selectitem parent;

	@ManyToOne
	@ForeignKey(name = "none")
	@JoinColumn(name = "module")
	@Fetch(FetchMode.JOIN)
	private Module module;

	private String code;

	private int dsporder;

	private String color;

	private String img;

	private String description;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public Selecttype getSelecttype() {
		return selecttype;
	}

	public void setSelecttype(Selecttype selecttype) {
		this.selecttype = selecttype;
	}

	public Selectitem getParent() {
		return parent;
	}

	public void setParent(Selectitem parent) {
		this.parent = parent;
	}
	
	public Module getModule() {
		return module;
	}

	public void setModule(Module module) {
		this.module = module;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public int getDsporder() {
		return dsporder;
	}

	public void setDsporder(int dsporder) {
		this.dsporder = dsporder;
	}

	public String getColor() {
		return color;
	}

	public void setColor(String color) {
		this.color = color;
	}

	public String getImg() {
		return img;
	}

	public void setImg(String img) {
		this.img = img;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

}
